<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{:config('param.web_name')}</title>
    <link rel="stylesheet" href="https://cdn.weibuyun.com/static/admin/layui/css/layui.css">
    <link rel="stylesheet" href="https://cdn.weibuyun.com/static/admin/css/style.css">
    <link rel="stylesheet" href="https://cdn.weibuyun.com/static/admin/css/index.css">
</head>
<body>
<div class="slideshow">
    <div class="slideshow-image" style="background-image: url('/static/admin/img/bg9.jpg')"></div>
    <div class="slideshow-image" style="background-image: url('/static/admin/img/bg2.jpg')"></div>
    <div class="slideshow-image" style="background-image: url('/static/admin/img/bg4.jpg')"></div>
    <div class="slideshow-image" style="background-image: url('/static/admin/img/bg8.jpg')"></div>
</div>
<div class="container" id="container">
    <div class="form-container sign-in-container">
        <form action="#">
            <h1>{:config('param.web_name')}</h1>
            <div class="login-box login-body layui-form">
                <div class="layui-form-item">
                    <label class="login-icon layui-icon layui-icon-username" for="username"></label>
                    <input type="text" name="username" id="username" lay-verify="required" placeholder="登录名"
                           class="layui-input">
                </div>
                <div class="layui-form-item">
                    <label class="login-icon layui-icon layui-icon-password" for="password"></label>
                    <input type="password" name="password" id="password" lay-verify="required" placeholder="密码"
                           class="layui-input">
                </div>
                <div class="layui-form-item">
                    <img src="{:captcha_src()}" class="login-codeimg" id="vercode">
                </div>

                <div class="layui-form-item">

                    <label class="login-icon layui-icon layui-icon-vercode" for="captcha"></label>
                    <input type="text" name="captcha" id="captcha"
                           placeholder="图形验证码" class="layui-input" lay-verify="required">

                </div>

                <!-- <div class="layui-form-item" style="margin-bottom: 20px;">
                <input type="checkbox" name="remember" value="1" lay-skin="primary" title="记住密码">
                </div> -->
                <div class="layui-form-item">
                    <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="login">登 入</button>
                </div>
            </div>
        </form>
    </div>
    <div class="overlay-container">
        <div class="overlay">

            <div class="overlay-panel overlay-right">

                <img src="" width="200" id="qrcode">
                <p class="wx_p"> 微信扫码登录</p>
            </div>
        </div>
    </div>
</div>
<style>

</style>
<!--<div class="video_div">-->
<!--    <video class="bgvid" id="bgvid" autoplay="autoplay" muted="muted" volume="0"  loop="loop" style="width: 100%; height: 100%;object-fit:cover;object-position:center center" class="section-background-video">-->
<!--           <source type="video/mp4" src="https://cdn.weibuyun.com/static/admin/img/tgit.mp4">-->

<!--    </video>-->
<!--    <div class="section-background-overlay background-overlay grid-overlay-0 " style="background-color: rgba(48,38,38,0.7);"></div>-->
<!--</div>-->

<div class="login-footer">

    <p><span style="color:white;">©{:date('Y')} by {:config('param.web_name')} <a href="https://www.beian.miit.gov.cn">冀ICP备17021107号-1</a> </span>
    </p>
</div>
<script src="https://cdn.weibuyun.com/static/admin/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(['form', 'layer', 'element'], function () {
        var layer = layui.layer
            , $ = layui.$
            , element = layui.element;
        qrcode()
        var myVar = setInterval(qrcode, 7000);

        function qrcode() {
            $.ajax({
                url: '{:url("qrcode")}',
                type: 'POST',
                dataType: 'json'
            })
                .done(function (res) {
                    if (res.code == 0) {
                        $('#qrcode').attr('src', res.url);
                    } else {
                       window.location.href = res.url
                    }
                })
                .fail(function () {
                    layer.msg('服务器异常', {
                        offset: 'rt',
                        anim: 5
                    });
                })
                .always(function () {
                });
        }

        $('#vercode').click(function () {
            var src = '{:captcha_src()}';
            $(this).attr('src', src + '?' + Math.random());
        });

        layui.form.on('submit(login)', function (data) {
            var self = $(data.elem);
            if (self.attr('disabled')) {
                return false;
            }
            self.attr('disabled', 'disabled');
            $.ajax({
                url: data.action || '',
                type: 'POST',
                dataType: 'json',
                data: data.field
            })
                .done(function (res) {
                    if (res.code == 1) {
                        layer.msg(res.msg, {
                            time: 1000,
                            icon: 6
                        }, function () {
                            console.log(res.url);
                            window.location.href = res.url
                        });
                    } else if (res.code == 2) {
                        layer.msg(res.msg, {
                            offset: 'rt',
                            time: 1500,
                            icon: 5,
                            anim: 5
                        });
                    } else {
                        layer.msg(res.msg, {
                            offset: 'rt',
                            time: 1500,
                            icon: 5,
                            anim: 5
                        });
                    }
                })
                .fail(function () {
                    layer.msg('正在生成二维码', {
                        time: 1500,
                        icon: 5
                    });
                })
                .always(function () {
                    $('#vercode').click();
                    self.removeAttr('disabled');
                });
            return false;
        });
    });
</script>
</body>

</html>